﻿
<!DOCTYPE html>
<html lang="en">
<head>
    @include('head')
    <title>去运动吧|临河索菲特乒羽馆|羽毛球|场地在线实时预订指定平台</title>
    <meta name="keywords" content="羽毛球 , 在线预订,场地实时预订,预订平台,去运动吧在线预订,最近的羽毛球场馆,价格最优惠,好评的场馆" />
	<meta name="description" content=" 临河索菲特乒羽馆是去运动吧——专业的运动场地在线预订平台的合作商家,去运动吧是临河索菲特乒羽馆唯一指定的羽毛球 场地在线预订平台,去运动吧提供最专业的场地在线预订服务,去运动吧提供专业的可预订的运动类型包括羽毛球,网球,足球,篮球等。想运动，就去运动吧！" />

</head>

<body>

@include('header')

<div class="ChangeRow"></div>
    <div id="Venues_ad" style="background: url(/images/sports_banner_image.jpg);background-position:center;background-size:cover;background-repeat:no-repeat;"></div>
    <div id="Index_main">
        <div class="Venues_main">
            <div class="VenuesTop">
                <div class="topLeft btn2" onclick='javascript:location.href="{{back()}}"' >
                    <div class="goBack"></div>
                    <div class="Blue TxtAlignCenter">返回</div>
                </div>
                <div class="topCenter">

                    <div><span class="VenuesPageName Black">{{$stadium[0]['stadiumname']}} - <a href="{{url('/stadium/1')}}">{{$stadium[0]['stadiumname']}}在线预订</a></span></div>

                    <div class="ChangeRow"></div>
                    <div><span class="VenuesAdd GrayCCC">{{$stadium[0]['address']}}</span><span  class="MapPointer"></span></div>
                    <div class="ChangeRow"></div>
                                    <a href="javascript:showid('loginBox','fav');">
                                        <div class="fav bgBlack white padding05em coner04em btn F05em">加入收藏</div>
                    </a>
                </div>
                <div class="topRight">
                    <nav>在线预订咨询</nav>
                    <nav class="F2em"><span class="fa  fa-phone-square "></span><span class="TelephoneNumber">400-871-7128</span></nav>
                </div>
            </div>
            <div class="ChangeRow"></div>
            <div id="SpaceSum" class="SpaceSum">
                                    <nav>当前可预订的场次: <span class="Green F2em">2112</span></nav>
                    <nav class="bgGreen1 white paddingLR05em coner04em">可预订</nav>
                    <nav class=" bgGreen2 white paddingLR05em coner04em">可抢订</nav>
                    <nav class=" bgOringe white paddingLR05em coner04em">已选中</nav>
                    <nav class=" bgGray GrayCCC paddingLR05em coner04em">已占用</nav>

            </div>
            <div class="ChangeRow"></div>
            <div class="AllDates">

                        @foreach($date as $v)
                            @if($d == $v->date)
                                <a href="{{url('stadium_detail', [$v->stadium_id, $v->date])}}">
                                <div class="SelectedDay borderOringe coner04em">
                                    <nav class=" F1_2em ">{{date('l', strtotime($v->date) )}}</nav>
                                    <nav class="bgOringe SelectedYMD white">{{$v->date}}</nav>
                                </div>
                                </a>
                            @else
                                <a href="{{url('stadium_detail', [$v->stadium_id, $v->date])}}">
                                <div class="SelectedDay borderOringe coner04em">
                                    <nav class=" F1_2em ">{{date('l', strtotime($v->date) )}}</nav>
                                    <nav class="bgGreen1 SelectedYMD white">{{$v->date}}</nav>
                                </div>
                                </a>
                            @endif

                        @endforeach
                            </div>
                        <div class="AllSpace">
                <div class="times">
                    <nav class="bgBlack coner04em padding05emMarginR1px white TxtAlignCenter">场次</nav>
                        @foreach($time as $t)
                            <nav class="bgBlack coner04em padding05emMarginR1px white ">{{substr($t->time, 0, 5)}}</nav>
                        @endforeach
                    </div>
                <div class=" ChangeRow"></div>
                    @foreach($number as $n)
                    <div class="spaceRow">
                    <nav class="bgBlack coner04em padding05emMarginR1px white">普通场{{$n->number}}</nav>

                            @foreach($price as $p)
                                @if($p->number == $n->number)
                                    @if($p->status == 1)
                                        <nav data-discount="0" id="{{$p->number}}_{{substr($p->time, 0, 2)}}_{{ substr($p->time, 0, 2) }}_{{$p->price}}_{{ date('Ymd', strtotime($p->date) ) }}" class="bgGreen1  coner04em padding05emMarginR1px white TxtAlignCenter btn click_selected">￥{{$p->price}}</nav>
                                    @else
                                        <nav data-discount="0" id="{{$p->number}}_{{substr($p->time, 0, 2)}}_{{ substr($p->time, 0, 2) }}_{{$p->price}}_{{ date('Ymd', strtotime($p->date) ) }}" class="bgGray coner04em padding05emMarginR1px white  TxtAlignCenter ">&nbsp;&nbsp;</nav>
                                    @endif
                                @endif
                            @endforeach

                    <div class=" ChangeRow"></div>
                    </div>
                    @endforeach


                            </div>
            <div class="SelectedSpaces" style="display: none">
                <form action="{{url('/postorder')}}" method="POST">
                    {!! csrf_field() !!}

                    <input type="text" name="" value="" placeholder="">
                    <div>
                        <div class="modpic2em" id="Mod_1" style="background-image:{{url('/images/icon_1.png')}}">
                    </div>
                    <span>场地类型:羽毛球</span></div>
                    <div class="ChangeRow">

                    </div>
                    <div id="order_detail"></div>
                    <div class="ChangeRow">&nbsp;</div>
                    <div >
                        <strong>去运动吧补贴:<span class="RedF00"> - ￥<label id="discount_price">0</label></span></strong>
                    </div>
                    <div class="RedF90 Margin1emA1emA F1_2em"><strong><span>合计: ￥<label id="order_price_sum">0</label><input type="hidden" id="order_price_true" value="0" /></span></strong></div>

                    <input type="submit" class=" bgOringe coner04em white padding05em btn Margin2emA2emA" value="提交订单"/>
                </form>
            </div>
                        <!-- / 场地预订 end-->
            <div class="ChangeRow"></div>
            <div class="VenuesIcons">
                    <li style="background-image:url(/images/3.png)" onmouseover="this.innerHTML='<span class=white>侧灯照明</span>'" onmouseout="this.innerHTML=''"></li>
                    <li style="background-image:url(/images/5.png)" onmouseover="this.innerHTML='<span class=white>更衣间</span>'" onmouseout="this.innerHTML=''"></li>
                    <li style="background-image:url(/images/10.png)" onmouseover="this.innerHTML='<span class=white>洗浴</span>'" onmouseout="this.innerHTML=''"></li>
                    <li style="background-image:url(/images/11.png)" onmouseover="this.innerHTML='<span class=white>停车场</span>'" onmouseout="this.innerHTML=''"></li>
                    <li style="background-image:url(/images/13.png)" onmouseover="this.innerHTML='<span class=white>室内场地</span>'" onmouseout="this.innerHTML=''"></li>
            </div>

            <div class="ChangeRow"></div>
            <div class="VenuesContent">
                                <p><iframe width="604" height="365" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://j.map.baidu.com/Kd4h0"></iframe></p>
<p>
    <p>
    	<img src="/{{$stadium[0]['images'][0]}}" alt="" />
    </p>
    <p>
    	<img src="/{{$stadium[0]['images'][1]}}" alt="" />
    </p>
</p>
                <p><p>
	场馆内配备体育用品商店，商品齐全。 <span>场馆内部风格，体现运动元素。</span>
</p>
<p>
	<img src="/images/场馆介绍.jpg" alt="" />
</p>
<p>
	场馆内部风格，体现运动元素。 <span>同时设有儿童活动区域，方便带孩子打球的家</span><span>长</span><span>。</span>
</p>
<p>
	<img src="/images/场馆介绍2.jpg" alt="" />
</p></p>
            </div>
            <div class="otherSport">
                <div class="F1_2em Black lineheight3em FloatLeft">本场馆的其他运动场地</div>
                <div class="line1pxDot"></div>
                    <a href="/stadium/1"  title="乒乓球" alt="乒乓球">
                        <div class="modpic6em" style="background-image:url(/images/icon_2.png)"></div>
                    </a>
                <div class="ChangeRow"></div>
                <div class="line1pxDot"></div>
            </div>
        </div>
    </div>


@include('footer')


<input id="action_name" type="hidden"  value=""/>
</body>
</html>
<!--弹出的浮动层 -->
<div class="changeDiv" id="loginBox" >
    <div class="loginBoxDiv coner04em">
        <div class="F1_2em Green padding05em check_login" id="login_msg">亲，您好像还没登录哦！</div>
        <p>
            <input class="loginBox_input_up" id="uname"  value="" placeholder="手机号" maxlength="11"/>
            <input class="loginBox_input_down" id="upwd" type="password" placeholder="密码" onkeydown="if (event.keyCode==13){$('.loginBox_form_login_button').click();}"/>
        </p>
        <nav class="loginBox_form_login_button">立即登录</nav>
        <p><a href="#" class="Blue">忘记密码?</a> | <a href="" class="Green">免费快捷注册</a></p>
        <p class="otherLogin">
            <nav class="ChangeRow"></nav>
            <span class="QQ"><a href=""><img src="/images/qq.png" alt="QQ快捷登录" /></a></span>
        </p>
    </div>
</div>
<script type="text/javascript" src="/js/dumpdiv.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        // $("form").submit(function () {
        //     if($('#login_msg').hasClass('check_login')){
        //         showid('loginBox','order');
        //         return false;
        //     }
        // });

        $('.loginBox_form_login_button').click(function(){
            var uname = $('#uname').val();
            var upwd = $('#upwd').val();
            if(uname.length!=11 || upwd.length<6){
                $('#login_msg').removeClass('Green').addClass('RedF00');
                $('#login_msg').html('登录信息有误,请重新输入!');
            }else{
                $.ajax({
                    url:'',
                    type:'POST',
                    data:'s=1&uname='+uname+'&pwd='+upwd,
                    success:function(str){
                        if(str){
                            $('#login_msg').toggleClass('Green').addClass('RedF00');
                            $('#login_msg').html(str);
                        }else{
                            $('#login_msg').removeClass('check_login');
                            if('order'==$('#action_name').val()){
                                $("form").submit();
                            }else{
                                close_layer('loginBox');
                                fav_Venues();
                            }
                        }
                    }
                });
            }
        });
    });
</script>
<script type="text/javascript">
    function fav_Venues(){
        $.ajax({
            url:'',
            type:'GET',
            data:'id=100065',
            success:function(str){
                alert(str);
                document.location.reload();
            }
        });
    }

    function checkJson(jsonStr,key,val){
        if(typeof val === "undefined") {
            delete jsonStr[key];
        } else {
            jsonStr[key] = val;
        }
    }

    var jsonstr,order_space_json={};
    var COOKIENAME = '083241603e5c7412e0f67f59f7c77cb4';
    var order_space_str = $.cookie(COOKIENAME);
    if(typeof order_space_str !== 'undefined'){
        order_space_json = JSON.parse(order_space_str);
		discount_price_json = 0;
        for(var space in order_space_json){
            if('price'!=space){
                $('#order_detail').append(order_space_json[space]['detail']);
                $("#"+order_space_json[space]['id']).addClass("bgOringe");
                $("#"+order_space_json[space]['id']).removeClass("bgGreen1");
				discount_price_json = discount_price_json + parseInt($('#'+order_space_json[space]['id']).attr('data-discount'));
            }
        }
		$('#order_price_true').val(order_space_json.price);
		$('#order_price_sum').text(order_space_json.price);
		$('#discount_price').text(discount_price_json);
        $('.SelectedSpaces').show();
    }

    function cancel_space(space_str){
        $('#'+space_str).addClass("bgGreen1");
        $('#'+space_str).removeClass("bgOringe");
        var space_arr = space_str.split('_');
        var space_div_id = "space_"+parseInt(space_arr[4])+"_"+parseInt(space_arr[0])+"_"+parseInt(space_arr[1]);
        var price = parseInt($('#order_price_sum').text())-parseInt(space_arr[3])+parseInt($('#'+space_str).attr('data-discount'));
		var discount_price = parseInt($('#discount_price').text())-parseInt($('#'+space_str).attr('data-discount'));
		$('#order_price_true').val(price);
		$('#discount_price').text(discount_price);
        $('#order_price_sum').text(price);
        $('#'+space_div_id).remove();

        checkJson(order_space_json,space_div_id);
        checkJson(order_space_json,'price',price);
        jsonstr = JSON.stringify(order_space_json);
        $.cookie(COOKIENAME,jsonstr,{domain: 'qyd8.com'});

        if("" == $('#order_detail').text()){
            $('.SelectedSpaces').hide();
            $.removeCookie(COOKIENAME);
        }
    }

    $(document).ready(function(){
        $(".click_selected").click(function(){
            if($(this).hasClass('bgOringe')){
                cancel_space($(this).attr('id'));
            }else{
                var space_count = $('#order_detail').children('nav').length;
                if(space_count >=8){
                    alert('哇哦,您已经订了8场了哟,要不先去完成订单吧!');
                }else{
                    $(this).addClass("bgOringe");
                    $(this).removeClass("bgGreen1");
                    var space_str = $(this).attr('id');
                    var space_arr = space_str.split('_');
                    var space_id = parseInt(space_arr[0]);
                    var time_id = space_arr[1];
                    var space_div_id = "space_20160824_"+space_id+"_"+time_id;
                    var time_name = space_arr[2];
                    var date = space_arr[4];
					var discount_price = parseInt($(this).attr('data-discount'))+parseInt($('#discount_price').text());
					var price = parseInt(space_arr[3])+parseInt($('#order_price_true').val() - parseInt($(this).attr('data-discount')));
                    var space_list_html = "<nav id='"+space_div_id+"' class='flyToList coner04em borderGreen Green'>";
                    space_list_html += "<span>"+space_id+"号场</span>";
                    space_list_html += "<span>"+date+"</span>";
                    space_list_html += "<span>"+time_id+":00场次</span>";
                    space_list_html += "<input type='hidden' data-discount='"+$(this).attr('data-discount')+"' value='"+space_str+"' name='space_value[]' />";
                    space_list_html += "<span class='fa fa-times-circle pointer' onclick='cancel_space(\""+space_str+"\")'></span></nav>";
					$('#order_price_true').val(price);
					$('#discount_price').text(discount_price);
					$('#order_price_sum').text(price);
                    $('#order_detail').append(space_list_html);
                    $('.SelectedSpaces').show();

                    checkJson(order_space_json,space_div_id,{detail:space_list_html,id:space_str});
                    checkJson(order_space_json,'price',price);
                    jsonstr = JSON.stringify(order_space_json);
                    $.cookie(COOKIENAME,jsonstr,{domain: 'qyd8.com'});
                }
            }
        });
    });
</script>
